<template>
  <div class="audition152">
    <code class="code">
      // 假定<br />
      var <span class="color3">user</span> = { <br />
        <span class="indient">a: 1,</span><br />
        <span class="indient">b: 2,</span><br />
        <span class="indient">c: 3,</span><br />
        <span class="indient">d: undefined</span><br />
      }
    </code>
    <h3><strong>验证：</strong></h3>
    <code class="code">
      // 1.<br />
      console.log('a' <span class="color4">in</span> user) // true<br />
      // 2.<br />
      console.log(user.<span class="color5">hasOwnProperty</span>('a')) // true
    </code>
    <h3><strong>打印属性：</strong></h3>
    <code class="code">
      // 1.<br />
      console.log(Object.keys(user)) // ['a', 'b', 'c', 'd']<br />
      // 2.<br />
      for (let k in user) {<br />
        <span class="indient">console.log(k) // 'a', 'b', 'c', 'd'</span><br />
      }
    </code>
  </div>
</template>

<script>
export default {
  name: 'Audition152'
}
</script>

<style>

</style>